<?phpsession_start();
include ("database.php");
/*
Template Name: Template VIew Detail Proposal
*/

	get_header();

	if (have_posts()) : while (have_posts()) : the_post(); 

	// GET CUSTOM SIDEBAR
	$sidebar = get_post_meta($post->ID, 'sidebar_value', true);

	?><head><?php //if you have not login yet. must be login firstif(!isset($_SESSION[login])){echo "Please Register / Login first..!!";}else{$_SESSION[proposal_id] = $_GET[proposal_id];?><link rel='stylesheet' type='text/css' href='<?php echo bloginfo('template_url') ?>/dashboard.css' /><link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_url') ?>/main_dashboard.css"/></head>	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript" src="<?php echo bloginfo('template_url') ?>/js/script.js"></script><br><br>    <div id="dolphincontainer">    <div id="dolphinnav">    <ul>	<?php if($_SESSION[user_type]=='entrepreneur') {?>    <li><a href="<?php echo bloginfo('url')?>/entrepreneur_dashboard/" title="" ><span>Dashboard</span></a></li>    <li><a href="<?php echo bloginfo('url')?>/add_proposal/" title="" ><span>Add Proposal</span></a></li>	<li><a href="<?php echo bloginfo('url')?>/search_investor/" title="" ><span>Search Investor</span></a></li>	<li><a href="<?php echo bloginfo('url')?>/search_partner/" title=""><span>Search Partner</span></a></li>    <li><a href="<?php echo bloginfo('url')?>/edit-profile/" title=""><span>Profile</span></a></li>	<li><a href="<?php echo bloginfo('url')?>/upgrade_plan/" title=""><span><font color=red>UPGRADE PLAN NOW</font></span></a></li>	<li><a href="<?php echo bloginfo('url')?>/buy_nudge/" title="" ><span><font color=red>Buy Nudge</font></span></a></li>   <?php } else if($_SESSION[user_type]=='investor') {   ?>      <li><a href="<?php echo bloginfo('url')?>/investor_dashboard/" title="" ><span>Dashboard</span></a></li>	<li><a href="<?php echo bloginfo('url')?>/search_proposal/" title="" ><span>Search Proposal</span></a></li>	<li><a href="<?php echo bloginfo('url')?>/investment_criteria/" title=""><span>Investment Criteria</span></a></li>    <li><a href="<?php echo bloginfo('url')?>/edit-profile/" title=""><span>Profile</span></a></li>	   <?php } ?>    </ul>    </div>    </div><script>$(document).ready(function(){ $("#company_information").click(function(){$("#div_company_information").css("display","block");$("#div_pitch_and_deal").css("display","none");$("#div_team").css("display","none");$("#div_finance").css("display","none");});	 $("#pitch_and_deal").click(function(){$("#div_pitch_and_deal").css("display","block");$("#div_company_information").css("display","none");$("#div_team").css("display","none");$("#div_finance").css("display","none");});	 $("#team").click(function(){$("#div_team").css("display","block");$("#div_company_information").css("display","none");$("#div_pitch_and_deal").css("display","none");$("#div_finance").css("display","none");});	 $("#finance").click(function(){$("#div_finance").css("display","block");$("#div_company_information").css("display","none");$("#div_pitch_and_deal").css("display","none");$("#div_team").css("display","none");});	 $("#like").click(function(){alert('Like this proposal.. Thx.');});	 $("#dislike").click(function(){alert('DisLike this proposal.. Thx.');});	 $("#bookmark").click(function(){alert('Bookmark this proposal.. Thx.');});	 $("#un-bookmark").click(function(){alert('Remove Bookmark this proposal.. Thx.');});	});	</script>
	<div id="content">

		<div class="contentbox <?php
			if ($sidebar == 'No sidebar') :

				echo'wfull';

			elseif ($sidebar == 'Buddy Sidebar') :

				echo'w720';

			else :

				echo'w620';

			endif; ?>">			<?php						$q_get_data= "select distinct proposal.privacy,user.user_id,user.user_type,user.image,user.message,user.first_name,user.last_name,user.password,user.contact_email,user.phone_number,user.pakage,user.payment_method,user.message from user,proposal where proposal.user_id=user.user_id and proposal.proposal_id = '$_GET[proposal_id]'";			$hq_get_data= mysql_db_query($DataBase,$q_get_data);			//echo $q_get_data;			while(list($privacy,$entrepreneur_id,$user_type,$image,$message,$first_name,$last_name,$password,$contact_email,$phone_number,$pakage,$payment_method,$message) = mysql_fetch_row($hq_get_data))			{			?>			<Table>			<tr >			<td width=300px>						</br></br>						<?php  if($image==''){ ?>			<img src="<?php echo bloginfo('template_url')?>/images/no_image.gif" width="250" height="250" />			<?php  }else {  ?>			<img src="data:image/jpeg;base64,<?php echo base64_encode($image); ?>" width="250" height="250" />			<?php }  ?>			</td>			<td>			<h2>Detail Profile:</h2></br></br>						<?php			//cek wether you are pro or global pro or novice			$q_cek= "select pakage,user_id from user where user_id = '$_SESSION[user_id]'";			$hq_cek= mysql_db_query($DataBase,$q_cek);			while(list($package,$user_id) = mysql_fetch_row($hq_cek))			{			?>			<?php if($package=='global pro' or $entrepreneur_id==$_SESSION[user_id]){ //if you are global pro user and if you view your own proposal ?>			<table>			<tr>			<td>proposal owner</td>			<td><b><?php echo $first_name." ".$last_name; ?></b></td>			</tr>			<?php if($privacy=='no'){ ?>			<tr>			<td>Contact Email</td>			<td><b><?php  echo $contact_email ?></b></td>			</tr>			<tr>			<td>Phone Number</td>			<td><b><?php  echo $phone_number ?></b></td>			</tr>			<tr>			<td>About Us</td>			<td><b><?php  echo $message ?></b></td>			</tr>			<tr>			<td>Social Networking</td>			</tr>			<tr>			<td colspan=2><?php  the_content(); ?></td>			</tr>			<tr>			<td><font><a href="javascript:window.print()"><img src="http://cdn-img.easyicon.net/png/5359/535949.png" width="20px" height="20px"></img></a></font></td>			</tr>			<?php }else{ ?>			<tr>			<td colspan=2>			<font color=red><p>Privacy Mode by The Owner</p></font>			</td>			</tr>			<?php } ?>			</table>			<?php  }else if($package=='pro'){ //if you are pro user ?>			<table>			<tr>			<td>proposal owner</td>			<td><b><?php echo $first_name." ".$last_name; ?></b></td>			</tr>			<?php if($privacy=='no'){ ?>			<tr>			<td>Contact Email</td>			<td><b><?php  echo $contact_email ?></b></td>			</tr>			<tr>			<td>About Us</td>			<td><b><?php  echo $message ?></b></td>			</tr>			<tr>			<td>More Profile Detail</td>			<td><b><font color=red><a href="<?php echo bloginfo('url')?>/upgrade_plan/">Upgrade Your Plan</a></font></b></td>			</tr>			<?php }else{ ?>			<tr>			<td colspan=2>			<font color=red><p>Privacy Mode by The Owner</p></font>			</td>			</tr>			<?php } ?>			</table>			<?php  }else if($package=='z_novice'){ //if you are novice user ?>			<table>			<tr>			<td>proposal owner</td>			<td><b><?php echo $first_name." ".$last_name; ?></b></td>			</tr>			<?php if($privacy=='no'){ ?>			<tr>			<td>About Us</td>			<td><b><?php  echo $message ?></b></td>			</tr>			<tr>			<td>More Profile Detail</td>			<td><b><font color=red><a href="<?php echo bloginfo('url')?>/upgrade_plan/">Upgrade Your Plan</a></font></b></td>			</tr>			<?php }else{ ?>			<tr>			<td colspan=2>			<font color=red><p>Privacy Mode by The Owner</p></font>			</td>			</tr>			<?php } ?>			</table>			<?php  }else if($package=='free'){ //if you are investor  ?>			<?php if($privacy=='no'){  //open all the contact detail ?>			<Table>			<tr>			<td>proposal owner</td>			<td><b><?php echo $first_name." ".$last_name; ?></b></td>			</tr>			<tr>			<td>Contact Email</td>			<td><b><?php  echo $contact_email ?></b></td>			</tr>			<tr>			<td>Phone Number</td>			<td><b><?php  echo $phone_number ?></b></td>			</tr>			<tr>			<td>About Us</td>			<td><b><?php  echo $message ?></b></td>			</tr>			<tr>			<td>Social Networking</td>			</tr>			<tr>			<td colspan=2><?php  the_content(); ?></td>			</tr>			<tr>			<td><font><a href="javascript:window.print()"><img src="http://cdn-img.easyicon.net/png/5359/535949.png" width="20px" height="20px"></img></a></font></td>			</tr>			</table>			<?php }else if($privacy=='yes'){ ?>			<table>			<tr>			<td>proposal owner</td>			<td><b><?php echo $first_name." ".$last_name; ?></b></td>			</tr>			<tr>			<td colspan=2>			<font color=red><p>Privacy Mode by The Owner</p></font>			</td>			</tr>			</table>			<?php } ?>			<?php }}  ?>					<?php 						if($_SESSION[user_type] =='investor')			{			$q_cek= "select * from interested_investor where proposal_id = '$_SESSION[proposal_id]' and investor_id='$_SESSION[user_id]' and entrepreneur_id='$entrepreneur_id'";			$hq_cek= mysql_db_query($DataBase,$q_cek);						if(mysql_num_rows($hq_cek)==0)			{			$date = date('Y-m-d G:i:s');			$q_like= "insert into interested_investor values ('$_SESSION[user_id]','$_SESSION[proposal_id]','$entrepreneur_id','dislike','$date')";			$hq_like	= mysql_db_query($DataBase,$q_like);			}			$q_like= "select status from interested_investor where proposal_id = '$_SESSION[proposal_id]' and investor_id='$_SESSION[user_id]'";			$hq_like= mysql_db_query($DataBase,$q_like);			while(list($status) = mysql_fetch_row($hq_like))			{			if($status=='like')			{			?>			<center><a href="<?php echo bloginfo('template_url')?>/like_process.php?status=dislike" id='dislike' name='dislike' ><img src="http://levynewsnetwork.files.wordpress.com/2011/07/facebook-dislike-button-via-geekword-com.png" height="10px" width="150px" /></a>&nbsp;&nbsp;&nbsp;						<?php } else if($status=='dislike') { ?>			<center><a href="<?php echo bloginfo('template_url')?>/like_process.php?status=like" id='like' name='like' ><img src="http://cultureslurp.com/wp-content/uploads/2011/09/Facebook-Like-Button.jpg" height="10px" width="150px" /></a>&nbsp;&nbsp;&nbsp;						<?php 			}}			$q_cek= "select * from bookmark where proposal_id = '$_SESSION[proposal_id]' and investor_id='$_SESSION[user_id]' and entrepreneur_id='$entrepreneur_id'";			$hq_cek= mysql_db_query($DataBase,$q_cek);			if(mysql_num_rows($hq_cek)==0)			{			$date = date('Y-m-d G:i:s');			$q_bookmark= "insert into bookmark values ('$_SESSION[user_id]','$_SESSION[proposal_id]','$entrepreneur_id','un-bookmark','$date')";			$hq_bookmark	= mysql_db_query($DataBase,$q_bookmark);			}			$q_bookmark= "select status from bookmark where proposal_id = '$_SESSION[proposal_id]' and investor_id='$_SESSION[user_id]'";			$hq_bookmark= mysql_db_query($DataBase,$q_bookmark);			while(list($status) = mysql_fetch_row($hq_bookmark))			{			if($status=='un-bookmark')			{			?>			<a href="<?php echo bloginfo('template_url')?>/bookmark_process.php?status=bookmark" id="bookmark" name="bookmark">			<img src="http://png-1.findicons.com/files/icons/316/hyperion/512/3d_bookmarks.png" height="30px" width="100px" />			</a>			<?php }else if($status=='bookmark') { ?>			<a href="<?php echo bloginfo('template_url')?>/bookmark_process.php?status=un-bookmark" id="un-bookmark" name="un-bookmark">			<img src="<?php echo bloginfo('template_url')?>/images/delete_bookmark.png" height="30px" width="100px" />			</a>						<?php 			} }} 			?>			</td>			</tr>			</table>						<div id="wrapper">						<hr><hr><hr>			<h2>Proposal Busiess Plan</h2>				<div id="content">		<div id="menu">			<ul>				<li><a href="#" title="Company Information" id="company_information" class="active">Company Information</a></li>				<li><a href="#" title="Pitch and Deal" id="pitch_and_deal">Pitch and Deal</a></li>				<li><a href="#" title="Team Member" id="team">Team</a></li>				<li><a href="#" title="finance" id="finance">Finance</a></li>							</ul>		</div>		<div id="div_company_information" style="display:block">		<div id="main">		Company Information								<?php			$q_get_proposal= "select expertise,state,viewer,company_name,website,management_location,industry_1,reason,stage,investor_role,previous_raise,total_raise,total_have_you_raised,minimum_investment,title,short_summary,the_pitch,highlight_1,highlight_2,highlight_3,highlight_4,highlight_5,the_deal,team_role_company,team_name,team_linkedin,team_position,date from proposal where proposal_id = '$_SESSION[proposal_id]'";			$hq_get_proposal= mysql_db_query($DataBase,$q_get_proposal);			//echo $q_get_data;			while(list($expertise,$state,$viewer,$company_name,$website,$management_location,$industry_1,$reason,$stage,$investor_role,$previous_raise,$total_raise,$total_have_you_raised,$minimum_investment,$title,$short_summary,$the_pitch,$highlight_1,$highlight_2,$highlight_3,$highlight_4,$highlight_5,$the_deal,$team_role_company,$team_name,$team_linkedin,$team_position,$date) = mysql_fetch_row($hq_get_proposal))			{						?>									<table border=1 style="">			<tr>		<td width="200px">		<b>Company Name :		</td>		<td>		<?php echo $company_name ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Company Website :		</td>		<td>		<?php echo $website ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Country :		</td>		<td>		<?php echo $management_location ?>		</td>		</tr>		<tr>		<td width="200px">		<b>State :		</td>		<td>		<?php echo $state ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Industry :		</td>		<td>		<?php echo $industry_1 ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Primary reason for needing Capital :		</td>		<td>		<?php echo $reason ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Stage :		</td>		<td>		<?php echo $stage ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Ideal Investor Role :		</td>		<td>		<?php echo $investor_role ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Ideal Investor Role If you did a previous round, how much did you raise?		</td>		<td>		<font ><?php echo number_format($previous_raise); ?></font>		</td>		</tr>		<tr>		<td width="200px">		<b>Capital Needed		</td>		<td>		<font  color=red><?php echo number_format($total_raise); ?></font>		</td>		</tr>		<tr>		<td width="200px">		<b>How much of this total have you raised?		</td>		<td>		<?php echo number_format($total_have_you_raised); ?>		</td>		</tr>		<tr>		<td width="200px">		<font><b>What is the minimum investment per investor?</font>		</td>		<td>		<font><?php echo number_format($minimum_investment); ?></font>		</td>		</tr>										</table>								</div>		</div>		<div id="div_pitch_and_deal" style="display:none">		<div id="main">			Pitch and Deal					<table border=1 style="">					<tr>		<td width="200px">		<b>Title :		</td>		<td>		<?php echo $title ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Short Summary :		</td>		<td>		<?php echo $short_summary ?>		</td>		</tr>		<tr>		<td width="200px">		<b>The Pitch :		</td>		<td>		<?php echo $the_pitch ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Highlight 1 :		</td>		<td>		<?php echo $highlight_1 ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Highlight 2 :		</td>		<td>		<?php echo $highlight_2 ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Highlight 3 :		</td>		<td>		<?php echo $highlight_3 ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Highlight 4 :		</td>		<td>		<?php echo $highlight_4 ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Highlight 5 :		</td>		<td>		<?php echo $highlight_5 ?>		</td>		</tr>		<tr>		<td width="200px">		<b>The Deal :		</td>		<td>		<?php echo $the_deal ?>		</td>		</tr>						</table>									</div>		</div>		<div id="div_team" style="display:none">		<div id="main">			Team		<table border=1 style="">						<tr>		<td width="200px">		<b>Description about the Team :		</td>		<td>		<?php echo $team_role_company ?>		</td>		</tr>			<tr>		<td width="200px">		<b>Team Member :		</td>		<td>		<?php echo $team_name ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Linkedin / Website :		</td>		<td>		<?php echo $team_linkedin ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Area of Expertise :		</td>		<td>		<?php echo $expertise ?>		</td>		</tr>		<tr>		<td width="200px">		<b>Position :		</td>		<td>		<?php echo $team_position ?>		</td>		</tr>										</table>			</div>		</div>						<div id="div_finance" style="display:none">		<?php		$q_get_finance= "select years,turnover,profit from finance where proposal_id = '$_SESSION[proposal_id]' ORDER BY years ASC";		$hq_get_finance= mysql_db_query($DataBase,$q_get_finance);						?>		<div id="main">			Financial		<table border=1 style="">			<tr>		<td colspan=3><b>Previous and Projected Finance</td>		</tr>				<tr>		<td width="200px">		<b>Year :</b>		</td>		<td>		<b>TurnOver: </b>		</td>		<td>		<b>Profit: </b>		</td>		</tr>		<?php		while(list($year,$turnover,$profit) = mysql_fetch_row($hq_get_finance))		{		?>				<tr>		<td width="200px">		<?php echo $year; ?>		</td>		<td>		SGD <?php echo number_format($turnover); ?>				</td>		<td>		SGD <?php echo number_format($profit); ?>		</td>		</tr>		<?php		}				?>		<tr>		<td colspan=3 >		<iframe src="<?php echo bloginfo('template_url')?>/graph.php?proposal_id='$_SESSION[proposal_id]'" width="100%" height="300px">		</iframe>		</td>		</tr>		</table>			</div>		</div>							<font>Viewer: <?php echo $viewer ?></font>						<?php				}		?>			</div>	</div>						<?php			}			?><?php if($_SESSION[user_type]=='entrepreneur'){ ?>			<a href="<?php echo bloginfo('url')?>/entrepreneur_dashboard/" ><img src="<?php echo bloginfo('template_url') ?>/images/back.jpg"></img></a>									<?php 			}else if($_SESSION[user_type]=='investor'){			?><a href="<?php echo bloginfo('url')?>/investor_dashboard/" ><img src="<?php echo bloginfo('template_url') ?>/images/back.jpg"></img></a>	<?php  } ?>						
			<?php}
				// CONTENT
				//the_content();

				echo '<div class="clear h20"><!-- --></div>';
				
				// PAGINATION
				wp_link_pages(array('before' => '<p><strong>'.__( 'Pages','pandathemes' ).':</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
				
				// COMMENTS ETC.
				if ( $theme_options['pages_metas'] == 'enable' ) : comments_template(); endif;

	endwhile;

		else : echo '<div class="contentbox w620"><h2>404</h2><p>'.__('Sorry, no posts matched your criteria.','pandathemes').'</p>';

	endif; ?>

	</div> <!-- end_of_contentbox -->

		<?php
			// SIDEBAR
			if ($sidebar == 'Buddy Sidebar') :
				include(TEMPLATEPATH.'/inc/sidebar_buddy.php');
			else :
				include(TEMPLATEPATH.'/inc/sidebar.php');
			endif;

	get_footer();

?>